package com.ls.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.List;

/**
 * <p>
 * 所属行业
 * </p>
 *
 * @author pengyu
 * @since 2024-10-12
 */
@NoArgsConstructor
@Data
@EqualsAndHashCode(callSuper = false)
public class Trade extends Model<Trade> {
    private static final long serialVersionUID=1L;

    /**
     * 自增主键
     */
    @TableId(value = "trade_id", type = IdType.AUTO)
    private Long tradeId;

    /**
     * 行业名称
     */
    private String tradeName;

    /**
     * 行业等级：1=1级，2=2级，3=3级 1>2>3
     */
    private Integer tradeLevel;

    /**
     * 父级行业id,0代表没有父级
     */
    private Long parentId;
    /**
     * 父级行业名称
     */
    private String parentName;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    @Override
    protected Serializable pkVal() {
        return this.tradeId;
    }
    @TableField(exist = false)
    private List<Trade> children;
}
